package com.swak.leader;

/**
 * 提供选主服务： 针对需要提供主从服务的场景，且能快速的切换
 * 
 * @author 618lf
 */
public interface LeaderService {

	/**
	 * 选择Leader
	 * 
	 * @param path
	 * @return
	 * @throws Exception
	 */
	Leader leaderSelect(String path) throws Exception;

	/**
	 * 选择Leader
	 * 
	 * @param path
	 * @param listener
	 * @return
	 * @throws Exception
	 */
	Leader leaderSelect(String path, com.swak.leader.ChangeListener listener) throws Exception;
}